package com.wqiuqiu.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wqiuqiu.common.PageUtils;
import com.wqiuqiu.common.to.mq.SecdKillOrderTo;
import com.wqiuqiu.gulimall.order.entity.OrderEntity;
import com.wqiuqiu.gulimall.order.vo.*;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author wqiuqiu
 * @email 18773489795@163.com
 * @date 2023-11-29 12:14:43
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    OrderConfirmVo toTrade() throws ExecutionException, InterruptedException;

    /**
     * 处理页面提交的购物车数据，来生成订单
     * @param submit
     * @return
     */
    SubmitResponseVo submitOrder(OrderSubmitVo submit);

    /**
     * 根据订单号，返回支付需要的信息
     * @param orderSn
     * @return
     */
    PayVo getOrderPay(String orderSn);

    PageUtils queryPageMemberOrder(int pageNum);

    /**
     * 处理支付宝支付之后的回调
     * @param vo
     * @return
     */
    String handlerPayed(PayAsyncVo vo);

    /**
     * 为秒杀服务创建订单
     * @param to
     */
    void createSeckillOrder(SecdKillOrderTo to);

    /**
     * 释放过期订单
     * @param orderSn
     */
    void releaseOrder(String orderSn);
}

